package com.token.sysflow.bean;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import com.token.sql.IntegrateSql;
import com.token.sql.AbstractTableBean;
/**
 * 环节功能开关
 * @author 代码创建
 */
public class FlowStepSwitchFunc extends AbstractTableBean {

	private String StepId; //环节ID
	private String FlowId; //流程ID
	private String SelectWay; //选择方式
	private String CanPrint; //可否打印
	private String CanUpload; //可否上传附件
	private String AutoWay; //智能跳转
	private String CanReturn; //可否退回
	private String SelectWayCheck; //选择方式1
	private String NoChecked; //选择方式2
	private String CanReturnCheck; //退回选项
	private String CanOther; //可否转审
	private String CanCC; //可否抄送
	private String CanOrgSign; //可否组织会签
	private String CanCame; //可否组织会审
	private String CanOver; //可否终止
	private String CanBack; //可否取回
	private String CanSubmitRePerson; //提交退回人
	private String NeedAttachmentCheck; //起草时检查附件必填
	private String NeedAttachmentTip; //附件必填提示
	private String CanDownload; //可否下载附件
	private String AutoWanType; //智能跳转选项
	private String CanWordExcel; //word/Excel操作

	public static String TABLE_NAME = "Flow_StepSwitchFunc";
	public static String TABLEKEY_NAME = "StepId";
	public FlowStepSwitchFunc (IntegrateSql f){
		super(f,TABLE_NAME);
		this.setKeyName(TABLEKEY_NAME);
	}

	public FlowStepSwitchFunc (IntegrateSql f,ResultSet rs) throws SQLException{
		super(f,TABLE_NAME);
		this.setKeyName(TABLEKEY_NAME);
		this.initParamToRs(rs);
	}

	public FlowStepSwitchFunc (IntegrateSql f,String keyValue) throws SQLException{
		super(f,TABLE_NAME);
		this.setKeyName(TABLEKEY_NAME);
		setCodePrepare(selectCodeById().toString());
		prepareSql.setPstValue(1, keyValue);
		ResultSet rs = executeQuery();
		if(rs.next()){
			initParamToRs(rs);
		}else{
			initParam();
		}
		rs.close();
	}

	@Override
	protected void initParam() {
		StepId = ""; //环节ID
		FlowId = ""; //流程ID
		SelectWay = ""; //选择方式
		CanPrint = ""; //可否打印
		CanUpload = ""; //可否上传附件
		AutoWay = ""; //智能跳转
		CanReturn = ""; //可否退回
		SelectWayCheck = ""; //选择方式1
		NoChecked = ""; //选择方式2
		CanReturnCheck = ""; //退回选项
		CanOther = ""; //可否转审
		CanCC = ""; //可否抄送
		CanOrgSign = ""; //可否组织会签
		CanCame = ""; //可否组织会审
		CanOver = ""; //可否终止
		CanBack = ""; //可否取回
		CanSubmitRePerson = ""; //提交退回人
		NeedAttachmentCheck = ""; //起草时检查附件必填
		NeedAttachmentTip = ""; //附件必填提示
		CanDownload = ""; //可否下载附件
		AutoWanType = ""; //智能跳转选项
		CanWordExcel = ""; //word/Excel操作
	}


	public void initParamToRs(ResultSet rs) throws SQLException{
		StepId = rs.getString("StepId"); //环节ID
		FlowId = rs.getString("FlowId"); //流程ID
		SelectWay = rs.getString("SelectWay"); //选择方式
		CanPrint = rs.getString("CanPrint"); //可否打印
		CanUpload = rs.getString("CanUpload"); //可否上传附件
		AutoWay = rs.getString("AutoWay"); //智能跳转
		CanReturn = rs.getString("CanReturn"); //可否退回
		SelectWayCheck = rs.getString("SelectWayCheck"); //选择方式1
		NoChecked = rs.getString("NoChecked"); //选择方式2
		CanReturnCheck = rs.getString("CanReturnCheck"); //退回选项
		CanOther = rs.getString("CanOther"); //可否转审
		CanCC = rs.getString("CanCC"); //可否抄送
		CanOrgSign = rs.getString("CanOrgSign"); //可否组织会签
		CanCame = rs.getString("CanCame"); //可否组织会审
		CanOver = rs.getString("CanOver"); //可否终止
		CanBack = rs.getString("CanBack"); //可否取回
		CanSubmitRePerson = rs.getString("CanSubmitRePerson"); //提交退回人
		NeedAttachmentCheck = rs.getString("NeedAttachmentCheck"); //起草时检查附件必填
		NeedAttachmentTip = rs.getString("NeedAttachmentTip"); //附件必填提示
		CanDownload = rs.getString("CanDownload"); //可否下载附件
		AutoWanType = rs.getString("AutoWanType"); //智能跳转选项
		CanWordExcel = rs.getString("CanWordExcel"); //word/Excel操作
		this.setKeyId(rs.getString("StepId"));
	}


	@Override
	protected int appendData() throws SQLException {
		int i = 1;
		prepareSql.setPstValue(i++,StepId); //环节ID
		prepareSql.setPstValue(i++,FlowId); //流程ID
		prepareSql.setPstValue(i++,SelectWay); //选择方式
		prepareSql.setPstValue(i++,CanPrint); //可否打印
		prepareSql.setPstValue(i++,CanUpload); //可否上传附件
		prepareSql.setPstValue(i++,AutoWay); //智能跳转
		prepareSql.setPstValue(i++,CanReturn); //可否退回
		prepareSql.setPstValue(i++,SelectWayCheck); //选择方式1
		prepareSql.setPstValue(i++,NoChecked); //选择方式2
		prepareSql.setPstValue(i++,CanReturnCheck); //退回选项
		prepareSql.setPstValue(i++,CanOther); //可否转审
		prepareSql.setPstValue(i++,CanCC); //可否抄送
		prepareSql.setPstValue(i++,CanOrgSign); //可否组织会签
		prepareSql.setPstValue(i++,CanCame); //可否组织会审
		prepareSql.setPstValue(i++,CanOver); //可否终止
		prepareSql.setPstValue(i++,CanBack); //可否取回
		prepareSql.setPstValue(i++,CanSubmitRePerson); //提交退回人
		prepareSql.setPstValue(i++,NeedAttachmentCheck); //起草时检查附件必填
		prepareSql.setPstValue(i++,NeedAttachmentTip); //附件必填提示
		prepareSql.setPstValue(i++,CanDownload); //可否下载附件
		prepareSql.setPstValue(i++,AutoWanType); //智能跳转选项
		prepareSql.setPstValue(i++,CanWordExcel); //word/Excel操作
		return i;
	}


	@Override
	public Vector<String> getFields() {
		Vector<String> vec = new Vector<String>();
		vec.addElement("StepId"); //环节ID
		vec.addElement("FlowId"); //流程ID
		vec.addElement("SelectWay"); //选择方式
		vec.addElement("CanPrint"); //可否打印
		vec.addElement("CanUpload"); //可否上传附件
		vec.addElement("AutoWay"); //智能跳转
		vec.addElement("CanReturn"); //可否退回
		vec.addElement("SelectWayCheck"); //选择方式1
		vec.addElement("NoChecked"); //选择方式2
		vec.addElement("CanReturnCheck"); //退回选项
		vec.addElement("CanOther"); //可否转审
		vec.addElement("CanCC"); //可否抄送
		vec.addElement("CanOrgSign"); //可否组织会签
		vec.addElement("CanCame"); //可否组织会审
		vec.addElement("CanOver"); //可否终止
		vec.addElement("CanBack"); //可否取回
		vec.addElement("CanSubmitRePerson"); //提交退回人
		vec.addElement("NeedAttachmentCheck"); //起草时检查附件必填
		vec.addElement("NeedAttachmentTip"); //附件必填提示
		vec.addElement("CanDownload"); //可否下载附件
		vec.addElement("AutoWanType"); //智能跳转选项
		vec.addElement("CanWordExcel"); //word/Excel操作
		return vec;
	}


	/**
	 * 设置环节ID
	 * @param stepid
	 */
	public void setStepId(String stepid){
		StepId = stepid;
	}
	/**
	 * 获取StepId
	 * @return 环节ID
	 */
	public String getStepId(){
		return StepId;
	}

	/**
	 * 设置流程ID
	 * @param flowid
	 */
	public void setFlowId(String flowid){
		FlowId = flowid;
	}
	/**
	 * 获取FlowId
	 * @return 流程ID
	 */
	public String getFlowId(){
		return FlowId;
	}

	/**
	 * 设置选择方式
	 * @param selectway
	 */
	public void setSelectWay(String selectway){
		SelectWay = selectway;
	}
	/**
	 * 获取SelectWay
	 * @return 选择方式
	 */
	public String getSelectWay(){
		return SelectWay;
	}

	/**
	 * 设置可否打印
	 * @param canprint
	 */
	public void setCanPrint(String canprint){
		CanPrint = canprint;
	}
	/**
	 * 获取CanPrint
	 * @return 可否打印
	 */
	public String getCanPrint(){
		return CanPrint;
	}

	/**
	 * 设置可否上传附件
	 * @param canupload
	 */
	public void setCanUpload(String canupload){
		CanUpload = canupload;
	}
	/**
	 * 获取CanUpload
	 * @return 可否上传附件
	 */
	public String getCanUpload(){
		return CanUpload;
	}

	/**
	 * 设置智能跳转
	 * @param autoway
	 */
	public void setAutoWay(String autoway){
		AutoWay = autoway;
	}
	/**
	 * 获取AutoWay
	 * @return 智能跳转
	 */
	public String getAutoWay(){
		return AutoWay;
	}

	/**
	 * 设置可否退回
	 * @param canreturn
	 */
	public void setCanReturn(String canreturn){
		CanReturn = canreturn;
	}
	/**
	 * 获取CanReturn
	 * @return 可否退回
	 */
	public String getCanReturn(){
		return CanReturn;
	}

	/**
	 * 设置选择方式1
	 * @param selectwaycheck
	 */
	public void setSelectWayCheck(String selectwaycheck){
		SelectWayCheck = selectwaycheck;
	}
	/**
	 * 获取SelectWayCheck
	 * @return 选择方式1
	 */
	public String getSelectWayCheck(){
		return SelectWayCheck;
	}

	/**
	 * 设置选择方式2
	 * @param nochecked
	 */
	public void setNoChecked(String nochecked){
		NoChecked = nochecked;
	}
	/**
	 * 获取NoChecked
	 * @return 选择方式2
	 */
	public String getNoChecked(){
		return NoChecked;
	}

	/**
	 * 设置退回选项
	 * @param canreturncheck
	 */
	public void setCanReturnCheck(String canreturncheck){
		CanReturnCheck = canreturncheck;
	}
	/**
	 * 获取CanReturnCheck
	 * @return 退回选项
	 */
	public String getCanReturnCheck(){
		return CanReturnCheck;
	}

	/**
	 * 设置可否转审
	 * @param canother
	 */
	public void setCanOther(String canother){
		CanOther = canother;
	}
	/**
	 * 获取CanOther
	 * @return 可否转审
	 */
	public String getCanOther(){
		return CanOther;
	}

	/**
	 * 设置可否抄送
	 * @param cancc
	 */
	public void setCanCC(String cancc){
		CanCC = cancc;
	}
	/**
	 * 获取CanCC
	 * @return 可否抄送
	 */
	public String getCanCC(){
		return CanCC;
	}

	/**
	 * 设置可否组织会签
	 * @param canorgsign
	 */
	public void setCanOrgSign(String canorgsign){
		CanOrgSign = canorgsign;
	}
	/**
	 * 获取CanOrgSign
	 * @return 可否组织会签
	 */
	public String getCanOrgSign(){
		return CanOrgSign;
	}

	/**
	 * 设置可否组织会审
	 * @param cancame
	 */
	public void setCanCame(String cancame){
		CanCame = cancame;
	}
	/**
	 * 获取CanCame
	 * @return 可否组织会审
	 */
	public String getCanCame(){
		return CanCame;
	}

	/**
	 * 设置可否终止
	 * @param canover
	 */
	public void setCanOver(String canover){
		CanOver = canover;
	}
	/**
	 * 获取CanOver
	 * @return 可否终止
	 */
	public String getCanOver(){
		return CanOver;
	}

	/**
	 * 设置可否取回
	 * @param canback
	 */
	public void setCanBack(String canback){
		CanBack = canback;
	}
	/**
	 * 获取CanBack
	 * @return 可否取回
	 */
	public String getCanBack(){
		return CanBack;
	}

	/**
	 * 设置提交退回人
	 * @param cansubmitreperson
	 */
	public void setCanSubmitRePerson(String cansubmitreperson){
		CanSubmitRePerson = cansubmitreperson;
	}
	/**
	 * 获取CanSubmitRePerson
	 * @return 提交退回人
	 */
	public String getCanSubmitRePerson(){
		return CanSubmitRePerson;
	}

	/**
	 * 设置起草时检查附件必填
	 * @param needattachmentcheck
	 */
	public void setNeedAttachmentCheck(String needattachmentcheck){
		NeedAttachmentCheck = needattachmentcheck;
	}
	/**
	 * 获取NeedAttachmentCheck
	 * @return 起草时检查附件必填
	 */
	public String getNeedAttachmentCheck(){
		return NeedAttachmentCheck;
	}

	/**
	 * 设置附件必填提示
	 * @param needattachmenttip
	 */
	public void setNeedAttachmentTip(String needattachmenttip){
		NeedAttachmentTip = needattachmenttip;
	}
	/**
	 * 获取NeedAttachmentTip
	 * @return 附件必填提示
	 */
	public String getNeedAttachmentTip(){
		return NeedAttachmentTip;
	}

	/**
	 * 设置可否下载附件
	 * @param candownload
	 */
	public void setCanDownload(String candownload){
		CanDownload = candownload;
	}
	/**
	 * 获取CanDownload
	 * @return 可否下载附件
	 */
	public String getCanDownload(){
		return CanDownload;
	}

	/**
	 * 设置智能跳转选项
	 * @param autowantype
	 */
	public void setAutoWanType(String autowantype){
		AutoWanType = autowantype;
	}
	/**
	 * 获取AutoWanType
	 * @return 智能跳转选项
	 */
	public String getAutoWanType(){
		return AutoWanType;
	}

	/**
	 * 设置word/Excel操作
	 * @param canwordexcel
	 */
	public void setCanWordExcel(String canwordexcel){
		CanWordExcel = canwordexcel;
	}
	/**
	 * 获取CanWordExcel
	 * @return word/Excel操作
	 */
	public String getCanWordExcel(){
		return CanWordExcel;
	}

}
